package com.study.spmongodb.article.po;

import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * @author MI
 * @version 1.0
 * @date 2020/11/10 15:33
 */
@Document(collection = "mydb")
@CompoundIndexes({
        @CompoundIndex(name = "name_1", def = "{'name':1}", unique = true),
        @CompoundIndex(name = "timeSum.time_1_name_1", def = "{'cd':1,'name':1}")
})
@Data
public class Mydb {
    private String id;
    private String name;
    private Date cd;
}
